home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Dev / Amiga-E / E_v3.2a / Src / Intui / AppMenuItem.e next >
Text File  |  1992-09-02  |  604b  |  24 lines

  1. /* AppMenuItem.e, loosely adapted from RKRM libraries 3rd ed. */
  2.  
  3. OPT OSVERSION=37
  4.  
  5. MODULE 'wb'
  6.  
  7. DEF myport,appitem,appmsg
  8.  
  9. PROC main()
  10.   IF workbenchbase:=OpenLibrary('workbench.library',37)
  11.     IF myport:=CreateMsgPort()
  12.       IF appitem:=AddAppMenuItemA(0,0,'DisplayBeep()',myport,NIL)
  13.         WriteF('Come on, go and see whats in the Tools menu ...\n')
  14.         WaitPort(myport)
  15.         DisplayBeep(NIL)
  16.         WriteF('Wow, you found it!\n')
  17.         RemoveAppMenuItem(appitem)
  18.         WHILE appmsg:=GetMsg(myport) DO ReplyMsg(appmsg)
  19.       ENDIF
  20.       DeleteMsgPort(myport)
  21.     ENDIF
  22.   ENDIF
  23. ENDPROC
  24.